package br.com.quiz.bean;

import java.io.IOException;
import java.sql.SQLException;

import javax.faces.bean.ManagedBean;
import javax.faces.bean.SessionScoped;

import net.sf.jasperreports.engine.JRException;
import br.com.quiz.util.JSFUtil;
import br.com.quiz.util.ReportUtil;

@ManagedBean(name = "RelarotioMBTeste")
@SessionScoped
public class RelatorioMBTestesLuiz {
	Integer id;
	String alunoUsername;
	
	public String getAlunoUsername() {
		return alunoUsername;
	}
	
	public void setAlunoUsername(String alunoUsername) {
		this.alunoUsername = alunoUsername;
	}

	public Integer getId() {
		return id;
	}

	public void setId(Integer id) {
		this.id = id;
	}

	public void gerarRelatorio(){
		try {
			ReportUtil.gerarRelatorio("aluno");
		} catch (JRException e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
			JSFUtil.adicionarMensagemErro(e.toString());
		} catch (SQLException e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
			JSFUtil.adicionarMensagemErro(e.toString());
		} catch (IOException e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
			JSFUtil.adicionarMensagemErro(e.toString());
		}
	}

}
